package com.dotdashdot.pocketquest;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import com.me.libgdx_test.ClassLogDisplay;
import com.me.libgdx_test.InterfaceBilling;
import com.me.libgdx_test.ClassUnlockablePrototypes.UnlockFactory;

public class ClassDesktopBilling implements InterfaceBilling{

	private ClassLogDisplay logger;
   public ClassDesktopBilling() {
      // Assuming we can instantiate it like this
	   logger = new ClassLogDisplay("DesktopBilling");
   }

   public boolean submitPurchase(String item_name, int item_payload, Object return_object, Method return_method) {
	   logger.print("Desktop Purchase Made!");
	   logger.print("Name: " + item_name);
	   Object[] parameterTypes = new Object[2];
       parameterTypes[0] = item_payload;
       parameterTypes[1] = "1234567890";
	   try {
		   return_method.invoke(return_object, parameterTypes);
		} catch (IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IllegalArgumentException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InvocationTargetException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	   return false;
   }
}